import request from '@/utils/request'


export default{
    businessList(page, size,searchMap) {
        return request({
            url: `manage/shop/store/storeList?page=${page}&size=${size}&keyword=${searchMap.keyword}&cate_id=${searchMap.cate_id}&is_child=${searchMap.is_child}`,
            method: 'get',
        })
    },
    // 新建商家分类
    saveBusinessType(data){
        return request({
            url: `manage/shop/store/saveCate`,
            method: 'post',
            data:data
        })
    },
    // 删除分类
    removeBusinessType(id){
        return request({
            url: `manage/shop/store/delCate`,
            method: 'delete',
            data:id
        })
    },
    // 禁用启用
    disabledBusiness(id,status){
        return request({
            url: `manage/merchant/merchant/changeStatus?id=${id}&status=${status}`,
            method: 'post',
        })
    },
    // 商家类型列表
    businessTypeList(page, size) {
        return request({
            url: `manage/shop/store/shopCateList?page=${page}&size=${size}`,
            method: 'get',
        })
    },
    // 新建商家
    saveBusiness(data){
        return request({
            url: `manage/shop/store/saveStore`,
            method: 'post',
            data:data
        })
    },
    // 新建门店
    saveStore(data){
        return request({
            url: `manage/shop/store/saveSubStore`,
            method: 'post',
            data:data
        })
    },
    // 删除门店
    removeBusiness(id){
        return request({
            url: `manage/shop/store/delStore`,
            method: 'delete',
            data:id
        })
    },
    // 商家详情
    businessDetail(id) {
       return request({
           url: `manage/shop/store/detail?id=${id}`,
           method: 'get',
       })
   },
   //收银台记录
   cashierList(page,size,id,searchMap){
       return request({
           url:`manage/shop/store/cashier?id=${id}&page=${page}&size=${size}`,
           data:searchMap,
           method:'post'
       })
   },
   //收银台二维码
   cashierCode(id){
    return request({
        url: `manage/shop/store/cashierCode?id=${id}`,
        method: 'get',
    })
   },
   //商家收银台明细
   shopCashierList(page,size,data){
    return request({
        url: `manage/shopClient/order/cashier?page=${page}&size=${size}`,
        method: 'post',
        data
    })
   },
   //收银台二维码--商家端
   shopCashierCode(){
    return request({
        url: `manage/shop/store/cashierCode`,
        method: 'get',
    })
   },
}
